python apply a function on each element of a array

142

python apply a function on each element of a array -

>>> mylis = ['this is test', 'another test']
>>> [item.upper() for item in mylis]
['THIS IS TEST', 'ANOTHER TEST']

Comments

Submit
0 Comments